package com.lovi.io_;

import com.lovi.io_.decorator_.FileRe;

import java.io.*;

/**
 * 处理流的copy（主要是文本文件）
 * 不能是二进制哦
 */
public class BufCopy {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("D:\\桌面\\test1.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\桌面\\test5.txt"));
        String line;
        //边读边写
        while ((line = br.readLine())!=null){
            bw.write(line);
            //插入换行符号
            bw.newLine();
        }
        System.out.println("拷贝完毕...");
        br.close();
        bw.close();
    }
}
